package cn.pa4j.controller;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.crypto.SecureUtil;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

import java.net.URL;
import java.util.concurrent.ExecutorService;

public class UUIDController {

    @FXML
    private Button uuid_btn;
    @FXML
    private TextArea uuid_area;
    @FXML
    private TextField uuid_count;

    @FXML
    public void creatUUID() {
        uuid_area.clear();
        Integer count = Convert.toInt(uuid_count.getText());
        if (count > 1000) {

            ThreadUtil.newThread()
            ExecutorService executorService = ThreadUtil.newExecutor(count / 1000);
            executorService.s
        } else {
            for (int i = 0; i < count; i++) {
                uuid_area.appendText(SecureUtil.simpleUUID() + "\n");
            }
        }
    }
}
